#region File Description
//-----------------------------------------------------------------------------
// QuestNpc.cs
//
// Microsoft XNA Community Game Platform
// Copyright (C) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
#endregion

#region Using Statements
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework.Content;
using MilwormsGameData;
#endregion

namespace MilwormsGameData
{
    /// <summary>
    /// An NPC that does not fight and does not join the party.
    /// </summary>
    public class QuestNpc : Character
    {

        private String introduction;
        public String Introduction
        {
            get { return introduction; }
            set { introduction = value; }
        }

        private List<Dialog> dialogs =
            new List<Dialog>();

        /// <summary>
        /// The content names, positions, and orientations of quest Npcs on this map.
        /// </summary>
        public List<Dialog> Dialogs
        {
            get { return dialogs; }
            set { dialogs = value; }
        }

        #region Content Type Reader


        /// <summary>
        /// Read a QuestNpc object from the content pipeline.
        /// </summary>
        public class QuestNpcReader : ContentTypeReader<QuestNpc>
        {
            protected override QuestNpc Read(ContentReader input, 
                QuestNpc existingInstance)
            {
                QuestNpc questNpc = existingInstance;
                if (questNpc == null)
                {
                    questNpc = new QuestNpc();
                }
                input.ReadRawObject<Character>(questNpc as Character);
                questNpc.Introduction = input.ReadString();
                questNpc.Dialogs.AddRange(input.ReadObject<List<Dialog>>());
                return questNpc;
            }
        }


        #endregion
    }
}
